package cn.alterzhang.www.test;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Stack;
import java.util.concurrent.CountDownLatch;

/**
 * Created by zhangshuhan on 2019/1/31.
 */
public class ZKNoLock {

    public static void main(String[] args) {
        CountDownLatch countDown = new CountDownLatch(1);
        for (int i = 0; i < 10; i++) {
            new Thread(new Runnable() {
                @Override
                public void run() {

                    try {
                        countDown.await();
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss||SSS");
                    String orderNO = simpleDateFormat.format(new Date());
                    System.out.println(orderNO);
                }
            }).start();
        }
        countDown.countDown();
    }
}
